<?php

namespace app\index\controller;

use think\App;
use think\Controller;

class Index extends Base
{

    public function __construct(App $app = null)
    {
        parent::__construct($app);
    }

    /** 首页
     * @return mixed
     */
    public function index(){
        $notices =(new \app\common\model\Notice())->select();
        $this->assign("notices",$notices);
        return $this->fetch();
    }

    public function main(){
        $assessment = new \app\common\model\Assessment();
        $user = new \app\common\model\User();
        $notice = new \app\common\model\Notice();
        $file = new \app\common\model\File();
        $this->assign("assessment",$assessment->count());
        $this->assign("assessmentList",$assessment->order("id","desc")->limit(10)->select());
        $this->assign("user",$user->count());
        $this->assign("notice",$notice->count());
        $this->assign("file",$file->count());
        return $this->fetch();
    }

}
